Values in Flash can be numbers or strings. These values can be literal values ("auto") or represented by expressions (Substring (automobile, 1, 4)
).
Action scripting is not a "typed" language: a variable's type (string, integer, and so on) depends on the type of values assigned to the variable.
True and false/nonzero and zero
The terms True and False indicate whether a condition exists: The term False indicates that a condition does not exist. Flash also uses the number 0 as a numerical equivalent to False. Flash treats any nonzero number as true.
Flash treats any characters enclosed within quotation marks as strings instead of variables.
The method for obtaining a property's value depends on the context of the property relative to the current movie clip. For example, using the statement ( _x)
in the current movie clip returns the x position of the current movie clip.
For a property of another movie clip, use a pathname to target the movie clip. For example, the target and property name /Foo: _x
returns x
of movie clip Foo as a value.
When the target is an expression, use the GetProperty()
statement to return the value of a movie clip property. For example, to return the x-position of each spaceship in a video game with many spaceships, each in a movie clip numbered sequentially (/spaceship_1, /spaceship_2, ...), use the statement:
GetProperty("/spaceship_"&ShipNumber, _x)